<%@ page contentType="text/html;charset=UTF-8"  %>
<%@ page import="com.ufida.ebscg.comm.session.UserBean" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.util.*" %>
<%@page import="com.ufida.ebscg.business.bulletinmanage.BulletinallQueryServiceImpl"%>
<%@page import="nc.vo.ebscg.ggbulletmenu.BulletinMenuVO"%>
<%@page import="org.apache.commons.logging.LogFactory"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@page import="com.ufida.ebscg.comm.Constant" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>招商银行供应商门户-采购创造价值</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="announcement/css/announcss.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="./javascript/md5.js"></script>
<script language="JavaScript" type="text/javascript" src="./javascript/ajaxdeal.js"></script>
<script type="text/javascript">
 //javascript:window.history.forward(1);
  var indexx = 1;
  window.onload = function(){
  	if('${errs != null}' == 'true'){
  		if('${errs}'.toString().indexOf('现有其他登录') != -1){
  			var username = document.getElementsByName("username");
  			if(confirm('${errs}')){
  				//浏览器关闭
				var xhr = ajaxFunction();
				
				xhr.onreadystatechange = function(){
					if(xhr.readyState==4){
						if(xhr.status==200){
							document.getElementById("keyid").value = "lifei";
							logon();
							//var data = xhr.responseText;		//获取文本
							//document.getElementById("divcheck").innerHTML = data;
						}
					}
				}
				xhr.open("post","./user/exit.do?timeStamp="+new Date().getTime(),false);
				xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
				xhr.send("username="+encodeURI(encodeURI(username[0].value)));
  			}
  		}else if('${errs}'.toString().indexOf('正在审核中') != -1){
  			var username = document.getElementsByName("username");
  			var passwd = document.getElementsByName("passwd");
  			if(confirm('${errs}')){
  				//浏览器关闭
				var xhr = ajaxFunction();
				xhr.onreadystatechange = function(){
					if(xhr.readyState==4){
						if(xhr.status==200){
							//var data = xhr.responseText;		//获取文本
							//document.getElementById("divcheck").innerHTML = data;
							//window.location.href = './index.jsp';
							//username[0].value='343';
						}
					}
				}
				xhr.open("post","./user/exit.do?timeStamp="+new Date().getTime(),false);
				xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
				xhr.send("username=lyan");
				//document.getElementsByName("username")[0].value = "";
				//window.location.hash=indexx;  
    			//indexx++; 
				//xhr.send(null);
  			}
  		}else{
  			alert('${errs}');
  		}
  	}
  }
  function ajaxFunction(){
 	   var xmlHttp;
 	   try{ // Firefox, Opera 8.0+, Safari
 	        xmlHttp=new XMLHttpRequest();
 	    }
 	    catch (e){
 		   try{// Internet Explorer
 		         xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
 		      }
 		    catch (e){
 		      try{
 		         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
 		      }
 		      catch (e){}
 		      }
 	    }
 		return xmlHttp;
 	 }
  function con_code(){
       document.getElementById("authimgid").src="authimg?num="+new Date();    
  }
  function regedit(){
	  window.location.href="regedit.jsp"; 
	  }
  function logon(){
  	   
  	   	var username = document.getElementsByName("username");
  	  	var passwd = document.getElementsByName("passwd");
  	  	var wd=(document.getElementById("passwd").value);
  	  	
  	  	if(username[0].value == ""){
  	  		alert("请输入用户名!");
  	  		return;
  	  	}
  	  	
  	  	if(passwd[0].value == ""){
  	  		alert("请输入密码!");
  	  		return;
  	  	}
  	   document.getElementById("passwd").value = MD5(wd);
  	   <%if(Constant.CAOPEN){ %>
  	  try{
  	   //var keyId  = getKeyId();
  	   //if(keyId == "" || keyId == -1)
  	   //{
  	   	//	alert("获取USBKEY信息失败!");
  	   	//	return;
  	   //}
  	   //document.getElementById("keyid").value = keyId;
  	   document.loginForm.submit();
  	   
  	   }catch(e){
  	   		
  	   		//alert("请确认是否安装了ca认证软件!");
  		 alert("出现异常错误，请重新登录!");
  	   }
  	   <%}else{%>
  	   		 //document.getElementById("keyid").value = "lifei";
  	  		 document.loginForm.submit();
  	   <%}%>
  }
  
  function login()
  {
  	if(window.event.keyCode == 13)
  	{
  		logon();	
  		
  	}
  }
  
</script>
<%
   UserBean useBean=(UserBean)request.getSession().getAttribute("EBSCG_SESSION_ID_");
   
   //session.removeAttribute("EBSCG_SESSION_ID_");
   //session.invalidate();
   /*if(null != useBean){
	   String strUsers = (String) application.getAttribute("LOGINUSERS");
	   if(null != strUsers){
		   application.removeAttribute("LOGINUSERS"); 
		   strUsers=strUsers.replace(","+useBean.getTempUsername().toLowerCase(),"");
		   application.setAttribute("LOGINUSERS",strUsers); 
		}
	}*/
 %>
<%
	BulletinallQueryServiceImpl query = new BulletinallQueryServiceImpl();
	BulletinMenuVO[] bvos = query.queryBulletinMenuVOMore();
%>
<script language="vbscript">
		function getKeyId()

		
			Dim keyId
			Dim ret
			ret = 0 rem ret 必须赋初值

		   	if IsNull(CertSignAtl) then
					Alert("请确认您是否有权限上载文件")
					return
			end if 

			     CertSignAtl.GetTokenNoEx ret,keyId

				if ret = 0 then
					getKeyId = keyId
				Else
					getKeyId = -1
                end if
		end function

</script>

</head>

<body onkeydown = "login()">
<!--页面头部开始-->
<div id="index_top">
<ul>
<li class="vertical"><a href="http://www.cmbchina.com/" target="_blank">招商银行首页</a></li>
<li><a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('#');return(false);" style="behavior: url(#default#homepage)">设为首页</a></li>
</ul>
</div>
<!--页面头部结束-->
<div id="index_banner"></div>
<!--页面主体内容开始-->
<div id="index_content">
<!--登录框开始-->
<div class="login">
  <html:form  action="/login.do" method="post" >
  <html:hidden property="action" value="login" /> 
    <div style="height:15px;" class="f-12-F60000">
          <html:errors/>
    </div>
  <table border="0">   
    <tr>
      <td>用户名：</td>
      <td colspan="2"><html:text property="username"  ></html:text></td>
    </tr>
    <tr>
      <td>密    &nbsp;码：</td>
      <td colspan="2"><html:password property="passwd" styleId="passwd"></html:password></td>
    </tr>
    <tr>
      <td>验证码：</td>
      <td ><html:text  property="authcode" style="width:60px" /></td>
      <td><img id="authimgid"  src="authimg" width="80" height="20" /></td>
    </tr>
     <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><font onclick="con_code()" style="cursor:hand;">看不清换一张</font></td>
    </tr>
    <tr>
      <td colspan="3" class="center botton">
      	<img onclick = "logon()" width="54" src="images/index_meau_01.jpg" height="27" style="cursor:hand"/>&nbsp;&nbsp;
      	<img onclick = "regedit()"  src="images/regedit.jpg" width="54" height="27" style="cursor:hand"/>
      	<!-- <img onclick = "cancel()"  src="images/index_meau_02.jpg" width="54" height="27" style="cursor:hand"/> -->
      </td>
    </tr>
  </table>
  
  <input type="hidden" id="keyid" name="keyid" />
</html:form>
</div>
<!--登录框结束-->
<div class="text">
<table>
	<%
	try{
	if(bvos != null && bvos.length > 0)
	{
		for(int index=0; index<bvos.length; index++)
		{
			BulletinMenuVO bvo = bvos[index];
	
			if("通用公告".equals(bvo.getMenu_name()))
			{
%>
<tr>
	<td valign='top'  id='td<%=index%>'>
	<script language="javascript">
			loadXML('td<%=index%>',"announcement/bulletinmanage.do?type=3&mod=lyan&pk=<%=bvo.getPk_ebs_meun_id()%>&name=<%=bvo.getMenu_name()%>&random="+Math.random());
	</script>
	</td>
<%}}}}catch(Exception e)
{
	LogFactory.getLog("公告信息").error(e.getMessage(),e);
}

%>
</tr>
</table>
</div>
<div class="clear"></div>


</div>
<br>
<!--页面主体内容结束-->
<div id="index_bottom">
网站声明 | 友情链接 | 加入收藏夹
</div>
<div id="footer">
© 2009 招商银行 版权所有ICP许可证号 粤B2-20040497
</div>

<%if(Constant.CAOPEN){ %>
<OBJECT id="CertSignAtl" codebase="<%=Constant.CAURL%>"   height="0" hspace="0" width="0" align="center" classid="clsid:4FEA81CE-00EA-4FB2-850E-353C947B7A66" VIEWASTEXT>
</OBJECT>  
<%} %>
</body>
</html>
